<?php
namespace app\admin\controller;
use think\Controller;
use app\admin\model\Index as IndexModel;
class index extends Controller
{
	public function index()
	{
		$model = new IndexModel();
		$data = $model->select();
		if($data){
			$this->assign("user_list",$data);
			return \view("index");
		}else{
			echo "出错了";
		}
	}
	
	public function del()
	{
		\var_dump(\input("get."));
		$model = new IndexModel();
		$data = $model->deleteUser();
		if($data){
			$this->success("删除成功","Index/index");
		}else{
			$this->error("删除失败","Index/index");
		}
	}
	
	public function set()
	{
		$model =new IndexModel();
		$data = $model->getUser();
		if($data){
			$this->assign("user_data",$data);
			return \view("setUser");
		}else{
			return \view("index");
		}
	}
	
	public function set_action()
	{
		$model = new IndexModel();
		$res = $model->updata();
		if($res){
			$this->success("修改成功","Index/index");
		}else{
			$this->error("修改失败","Index/index");
		}
	}
	
	
}
?>